#define _CRT_SECURE_NO_WARNINGS  1
#include<stdio.h>
char line(long long int m)
{
    char s = 'n';
    long long int arr[10000];
    long long int i = 0;
    for (i = 0; i < m; i++)
    {
        scanf("%lld", &arr[i]);
    }
    long long int a = 0;
    long long int k = 0;
    for (a = 0; a < (m - 1); a++)
    {
        for (k = a + 2; k < (m - 1); k++)
        {
            if (((arr[a] < arr[k]) == (arr[a] < arr[k + 1])) && ((arr[a + 1] < arr[k]) != (arr[a + 1] < arr[k + 1])))
            {
                s = 'y';
            }
            if (((arr[a] < arr[k]) != (arr[a] < arr[k + 1])) && ((arr[a + 1] < arr[k]) == (arr[a + 1] < arr[k + 1])))
            {
                s = 'y';
            }
        }

    }
    return s;
}
int main()
{
    long long int n = 0;
    scanf("%lld", &n);
    long long int i = 0;
    for (i = 0; i < n; i++)
    {
        long long int m = 0;
        while (scanf("%lld", &m) != EOF)
        {
            char s = line(m);
            printf("%c\n", s);
        }
    }
    return 0;
}